// 额外费用管理相关API
import { axiosInstance } from './request'

const extraFeeAPI = {
  // 申请额外费用
  createExtraFee(data) {
    return axiosInstance({
      url: '/extra-fees',
      method: 'post',
      data,
    })
  },
  // 获取额外费用列表
  getExtraFees(params) {
    return axiosInstance({
      url: '/extra-fees',
      method: 'get',
      params,
    })
  },
  // 获取额外费用详情
  getExtraFee(id) {
    return axiosInstance({
      url: `/extra-fees/${id}`,
      method: 'get',
    })
  },
  // 更新额外费用
  updateExtraFee(id, data) {
    return axiosInstance({
      url: `/extra-fees/${id}`,
      method: 'put',
      data,
    })
  },
  // 审核额外费用
  auditExtraFee(id, data) {
    return axiosInstance({
      url: `/extra-fees/${id}/audit`,
      method: 'put',
      data,
    })
  },
  // 支付额外费用
  payExtraFee(id) {
    return axiosInstance({
      url: `/extra-fees/${id}/pay`,
      method: 'post',
    })
  },
  // 删除额外费用
  deleteExtraFee(id) {
    return axiosInstance({
      url: `/extra-fees/${id}`,
      method: 'delete',
    })
  }
}

// 导出整个 API 对象
export default extraFeeAPI

// 也可以单独导出每个方法
export const { createExtraFee, getExtraFees, getExtraFee, updateExtraFee, auditExtraFee, payExtraFee, deleteExtraFee } = extraFeeAPI 